#region Copyright RenGuiYou. All rights reserved.
//=====================================================
// NeatlyFrameWork
// Author:      RenGuiyou
// Feedback: 	mailto:750539605@qq.com
//=====================================================
#endregion
using Cysharp.Threading.Tasks;
using Neatly.UI;

namespace Neatly.Module
{
    public class UIFrameModule : ModuleSingleton<UIFrameModule>
    {
        public override async UniTask Init()
        {
            NeatlyUI.RegisterPaddingConfig(AtlasModule.Instance.GetUIPadding());
            NeatlyUI.RegisterSetSpriteAction(AtlasModule.Instance.SetSprite);
            NeatlyUI.RegisterAddAtlasRef(AtlasModule.Instance.AddRef);
            NeatlyUI.RegisterLoseAtlasRef(AtlasModule.Instance.LoseRef);
        }

        //登录加载
        public override void LoginLoad()
        {
            var emojiLibrary = AtlasModule.Instance.GetEmojiLibrary();
            if (emojiLibrary != null)
            {
                NeatlyUI.RegisterEmojiDirectory(emojiLibrary);
            }
        }
    }
}